AEGetParamDesc
AEGetParamDesc Obtain descriptor record for Apple Event parameter
#include <AppleEvents.h> Apple Event Manager
OSErr AEGetParamDesc ( theAppleEvent, AEKeyword, desiredType,
AppleEvent * theAppleEvent ; Apple event record
AEKeyword theAEKeyword ; Apple Event keyword
DescType desiredType ; Descriptor type
AEDesc * result ; Desired descriptor record
returns Error Code; 0 = no error
The parameter theAppleEvent is the Apple event containing the desired
parameter.
The parameter theAEKeyword is the keyword that specifies the desired
parameter.
The desiredType parameter specifies the descriptor type of the resulting
descriptor record; if the parameter is not of this type, the
Apple Event Manager attempts to coerce it into this type. If the value of
desiredType is typeWildCard, no coercion is performed, and the
descriptor type of the resulting descriptor record is the same as the
descriptor type of the Apple event's parameter.
The AEGetParamDesc function returns in the result parameter the
resulting descriptor record. This function creates a new descriptor record by
copying the descriptor record from the parameter. Your application is
responsible for using the AEDisposeDesc function to dispose of the resulting
descriptor record once you are finished using it.
If the function returns a nonzero result code, a descriptor record with the
typeNull descriptor type is returned. A descriptor record of this type does not
contain any data.
For an example program showing use of AEGetParamDesc, see the
description of Open Documents Event.
Result codes
noErr (0) No error
memFullErr (-108) Not enough room in heap zone
errAECoercionFail (-1700) Data could not be coerced to descriptor type
errAEDescNotFound (-1701) Descriptor type was not found
errAENotAEDesc (-1704) Not a valid descriptor record
errAEReplyNotArrived (-1718) Reply has not yet arrived